"use strict"

/**
 * 济南市政府采购网爬虫
 *  
 */

var Base = require("./base");
var jn_spider = new Base();
jn_spider.name = "济南市采购网";
jn_spider.page = 5;
jn_spider.encode = "GBK";

jn_spider.getPageUrl = function(pg) {
    var url = "http://www.ccgp-jinan.gov.cn/jngp/site/listInfo2.jsp?colid=121&curpage=1";
    if (pg != 1) {
        url = "http://www.ccgp-jinan.gov.cn/jngp/site/listInfo2.jsp?colid=121&curpage=" + pg;
    }
    return url;
};

jn_spider.getItems = function($) {
    var items = [];
    $(".list a").each(function(index, ele) {
        var e = $(ele);
        var item = {};
        item.title = e.text();
        item.url = "http://www.ccgp-jinan.gov.cn/" + e.attr("href");
        item.source = jn_spider.name;
        items.push(item);
    });
    return items;
};

exports = module.exports = jn_spider;